<script type="text/javascript">
      $.ajax({
                        type: 'POST',
                        url:'http://test.51dfs.cn/kder-api/user/checkLogin.do',
                        data:{},
						dataType:'json',
                        success:function(res){
                            if(res.code==="0"){
                                   var welcomeName = '';
                                  if(res.data.loginUser.peopleName){
                                        welcomeName  = res.data.loginUser.peopleName;
                                    }else{
                                         welcomeName  = res.data.loginUser.peoplePhone;
                                    }
                                 $(".welcome").text('Hi '+welcomeName+', 您好！');
                                 $("#myOrder").show();
                                 $("#logouta").show();
                                 $("#logina").hide();
                                 $("#registera").hide();
                            }else{
                                
                            }
                        }
                    })
                  //end ajax
  </script> 
<script type="text/javascript">
    	function chooseTop(type){
			var count = 6;
			for(var i=1;i<=count;i++){
				var $toA = $('#top_ng'+i);
				if(type == i){
					$toA.addClass('on');
				}else{
					$toA.removeClass('on');
				}
			}                     
		}
     
       function GetQueryString1(name){
			var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
			var r = window.location.search.substr(1).match(reg);
			if(r!=null)return  unescape(r[2]); return null;
        }
		$(document).ready(function(){
		var topIdx= GetQueryString1("topNgId");
		if(!topIdx){
			topIdx = 1;
		}
		chooseTop(topIdx);
		});
		
		function logoutFun(){
			$.ajax({
					type: 'POST',
					url:'http://test.51dfs.cn/kder-api/user/logout.do',
					data:{},
					dataType:'json',
					success:function(res){
						if(res.code==="0"){
							  location.href = "http://test.51dfs.cn/login.do";
						}else{
							
						}
					}
				})
			  //end ajax
		}
		
</script>
  
<div class="top-bar">
    <div class="container clearfix">
        <p class="left">
        </p>
        <p class="right">
            <a id="logina" href="{ms:global.host/}/login.do">登陆</a> |
            <a id="registera" href="{ms:global.url/}/182/index.html">注册</a>
			<a id="logouta" onclick="javascript:logoutFun();" style="display:none"  href="{ms:global.host/}">退出</a>
        </p>
    </div>
</div>
<div class="top-header">
    <div class="container clearfix">
        <a href="{ms:global.host/}" class="logo">
            <img src="{ms:globalskin.url/}/images/logo.png" alt="" width="177" height="47" />
        </a>
        <ul class="header-nav">
            <li><a   id="top_ng1" class="on" target="_self" href="{ms:global.host/}?topNgId=1">首 页</a></li>
            <li><a   id="top_ng2" target="_self" href="{ms:global.host/}/ins/view/index.do">全部保险产品</a></li>
            <li><a  id="top_ng3" target="_self" href="{ms:global.url/}/154/index.html?topNgId=3">保险理赔</a></li>
            <li><a  id="top_ng4" target="_self" href="{ms:global.url/}/177/index.html?topNgId=4">企业团险</a></li>
            <li><a  id="top_ng5" target="_self" href="{ms:global.url/}/93/94/index.html?topNgId=5">信息披露</a></li>
	   <!-- <li id="myOrder"  style="display:none"><a id="top_ng6" target="_self" href="center_orders.html?topNgId=6">我的保单</a></li>-->
        </ul>
        <div class="header-rnav right">
            <a href="{ms:global.url/}/155/index.html">
                <i class="i1"></i>
                定制
            </a>
            <a href="">
                <i class="i2"></i>
                公众号
                <div class="wechat-img">
                    <img src="{ms:globalskin.url/}/images/qr_code.png" alt="" width="94" height="94" />
                </div>
            </a>
        </div>
    </div>
</div>
